/**
* 版权归 瞄你个汪 所有。
* 使用本代码应遵守相关法律法规和许可证的要求。
*/
package cn.sqlsuper.seed;

import cn.sqlsuper.constants.ConstPool;
import cn.sqlsuper.entity.SysMenu;
import cn.sqlsuper.eunm.SysMenuTypeEnum;
import cn.sqlsuper.interfaces.SuperSeedData;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 系统菜单表种子数据
 * </p>
 *
 * @author 瞄你个汪
 * @since 2024/5/26 8:13
 */
public class SysMenuSeedData implements SuperSeedData<SysMenu> {
    @Override
    public List<SysMenu> getSeedData() {
        return new ArrayList<SysMenu>(){{
            add(newInstance(1300000000101L, 0L, "工作台", null, "/dashboard", "dashboard", "Layout", "ele-HomeFilled", false, null, false, SysMenuTypeEnum.Dir, 1000, ConstPool.PRIMARY_ID));
            add(newInstance(1300000000111L, 1300000000101L, "工作台", null, "/dashboard/home", "home", "/home/index", "ele-HomeFilled", false, null, true, SysMenuTypeEnum.Menu, 100, ConstPool.PRIMARY_ID));
            add(newInstance(1300000000121L, 1300000000101L, "站内信", null, "/dashboard/notice", "notice", "/home/notice/index", "ele-Bell", false, null, false, SysMenuTypeEnum.Menu, 110, ConstPool.PRIMARY_ID));

            add(newInstance(1310000000101L, 0L, "系统管理", null, "/system", "system", "Layout", "ele-Setting", false, null, false, SysMenuTypeEnum.Dir, 1010, ConstPool.PRIMARY_ID));
            add(newInstance(1300000000111L, 1310000000101L, "账号管理", null, "/system/user", "sysUser", "/system/user/index", "ele-User", false, null, false, SysMenuTypeEnum.Menu, 100, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000112L, 1300000000111L, "查询", "sysUser:page", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 100, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000113L, 1300000000111L, "编辑", "sysUser:update", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 110, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000114L, 1300000000111L, "增加", "sysUser:add", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 120, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000115L, 1300000000111L, "删除", "sysUser:delete", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 130, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000116L, 1300000000111L, "详情", "sysUser:detail", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 140, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000117L, 1300000000111L, "授权角色", "sysUser:grantRole", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 150, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000118L, 1300000000111L, "重置密码", "sysUser:resetPwd", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 160, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000119L, 1300000000111L, "设置状态", "sysUser:setStatus", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 170, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000120L, 1300000000111L, "强制下线", "sysUser:forceOffline", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 180, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000121L, 1300000000111L, "解除锁定", "sysUser:unlockLogin", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 190, ConstPool.PRIMARY_ID));

            add(newInstance(1310000000131L, 1310000000101L, "角色管理", null, "/system/role", "sysRole", "/system/role/index", "ele-Help", false, null, false, SysMenuTypeEnum.Menu, 110, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000132L, 1310000000131L, "查询", "sysRole:page", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 100, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000133L, 1310000000131L, "编辑", "sysRole:update", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 110, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000134L, 1310000000131L, "增加", "sysRole:add", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 120, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000135L, 1310000000131L, "删除", "sysRole:delete", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 130, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000136L, 1310000000131L, "详情", "sysRole:detail", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 140, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000137L, 1310000000131L, "授权菜单", "sysRole:grantMenu", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 150, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000138L, 1310000000131L, "授权数据", "sysRole:grantDataScope", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 160, ConstPool.PRIMARY_ID));

            add(newInstance(1310000000301L, 0L, "平台管理", null, "/platform", "platform", "Layout", "ele-Menu", false, null, false, SysMenuTypeEnum.Menu, 1020, ConstPool.PRIMARY_ID));

            add(newInstance(1310000000321L, 1310000000301L, "菜单管理", null, "/platform/menu", "sysMenu", "/system/menu/index", "ele-Menu", false, null, false, SysMenuTypeEnum.Menu, 110, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000322L, 1310000000321L, "查询", "sysMenu:page", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 100, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000323L, 1310000000321L, "编辑", "sysMenu:update", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 110, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000324L, 1310000000321L, "增加", "sysMenu:add", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 120, ConstPool.PRIMARY_ID));
            add(newInstance(1310000000325L, 1310000000321L, "删除", "sysMenu:delete", null, null, null, null, false, null, false, SysMenuTypeEnum.Btn, 130, ConstPool.PRIMARY_ID));
        }};
    }

    public SysMenu newInstance(Long id, Long pId, String title, String permission, String path, String name, String component, String icon, boolean isIframe, String outLink, boolean isAffix, SysMenuTypeEnum type, int orderBy, Long tenantId) {
        SysMenu menu = new SysMenu();

        menu.setId(id);
        menu.setPId(pId);
        menu.setTitle(title);
        menu.setPermission(permission);
        menu.setPath(path);
        menu.setName(name);
        menu.setComponent(component);
        menu.setIcon(icon);
        menu.setIsIframe(isIframe);
        menu.setOutLink(outLink);
        menu.setAffix(isAffix);
        menu.setType(type);
        menu.setOrderNo(orderBy);
        menu.setTenantId(tenantId);

        return menu;
    }
}
